import utils  from '@utils/index'

export const list = function() {
    return utils.service({
        url: '/m/delivery/address/list',
        method: 'get'
    })
}

export const mod = function(data) {
    return utils.service({
        url: '/m/delivery/address/mod',
        method: 'put',
        data
    })
}

export const add = function(data) {
    return utils.service({
        url: 'm/delivery/address/add',
        method: 'post',
        data
    })
}

export const get = function(data) {
    return utils.service({
        url: 'm/delivery/address/get/'+data.id,
        method: 'get'
    }) 
}

export const del = function(data) {
    return utils.service({
        url: 'm/delivery/address/del/'+data.id,
        method: 'delete'
    }) 
}

export const getProductDetail = function(data) {
    return utils.service({
        url: '/m/product/'+data.id,
        method: 'get'
    });
}

export const addToCart = function(data) {
    return utils.service({
        url: '/m/shoppingcart/add',
        method: 'post',
        data: data
    });
}